home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / bprof-1.1 / bprof-1 / bprof / execute.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-31  |  1.5 KB  |  45 lines

  1. /* -*- c++ -*- 
  2.    Header file for the executable class */
  3.  
  4. #pragma interface
  5.  
  6. #include <a.out.h>
  7.  
  8. class executable {
  9.     int fd;
  10.     unsigned int start;        // Starting core address of file
  11.     unsigned int filesize;    // Number of pc/count pairs in file
  12.     nlist* cursym;        // Current symbol in the file
  13.     nlist* maxsym;        // Points just after the last symbol
  14.     char* strs;            // The string table
  15.     unsigned int clow;        // Low pc value of current line
  16.     unsigned int chigh;        // High pc value of current line
  17.     const char* cdir;        // Current directory name
  18.     const char* cfile;        // Current file name
  19.     int cline;            // Current line number
  20.     time_t _mtime;        // Modification time of file
  21. public:
  22.     executable(const char* = "a.out");
  23.     ~executable(void);
  24.  
  25.     /* The lowest and (highest+1) value of the program counter in the
  26.        current line */
  27.     unsigned int lowpc(void) const { return clow; }
  28.     unsigned int highpc(void) const { return chigh; }
  29.  
  30.     /* dirname contains the directory of the main source file.
  31.        filename contains either a file in dirname or a complete
  32.        pathname if such was specified in the symbol table */
  33.     const char* dirname(void) const { return cdir; }
  34.     const char* filename(void) const { return cfile; }
  35.  
  36.     /* The current line number */
  37.     int lineno(void) const { return cline; }
  38.  
  39.     /* Go to the next line in the program */
  40.     int shift(void);
  41.  
  42.     /* Get the modification time of the file */
  43.     time_t mtime(void) const { return _mtime; }
  44. };
  45.